//
//  PicTableViewCell.m
//  TableView
//
//  Created by Carl_fang on 15/3/28.
//  Copyright (c) 2015年 Carl_fang. All rights reserved.
//

#import "PicTableViewCell.h"
#import "UIImageView+WebCache.h"

@interface PicTableViewCell()

@property (nonatomic, retain) UILabel *amountLabel;
@property (nonatomic, retain) UIImageView *picOneImage;
@property (nonatomic, retain) UIImageView *picTwoImage;
@property (nonatomic, retain) UIImageView *picThreeImage;
@property (nonatomic, retain) UIImageView *picFourImage;


@end

@implementation PicTableViewCell


-(void)setDetailArray:(NSMutableArray *)array detailMode:(DetailModel *)detailModel
{
    
    
    
    NSString *amount = [NSString stringWithFormat:@"%@张图片",detailModel.imageCount];
    _amountLabel.text = amount;
    
    
    if (array.count == 0) {
        
    }
    else
    {
        [_picOneImage setImageWithURL:[NSURL URLWithString:array[0]]];
        [_picTwoImage setImageWithURL:[NSURL URLWithString:array[1]]];
        [_picThreeImage setImageWithURL:[NSURL URLWithString:array[2]]];
        [_picFourImage setImageWithURL:[NSURL URLWithString:array[3]]];
    }
    
    
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        _amountLabel = [[UILabel alloc] init];
        _amountLabel.frame = CGRectMake(10, 10, 100, 20);
        //_amountLabel.backgroundColor = [UIColor blackColor];
        [self.contentView addSubview:_amountLabel];
        _picOneImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 40, 70, 70)];
        _picOneImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_picOneImage];
        _picTwoImage = [[UIImageView alloc] initWithFrame:CGRectMake(85, 40, 70, 70)];
        _picTwoImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_picTwoImage];
        _picThreeImage = [[UIImageView alloc] initWithFrame:CGRectMake(160, 40, 70, 70)];
        _picThreeImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_picThreeImage];
        _picFourImage = [[UIImageView alloc] initWithFrame:CGRectMake(235, 40, 70, 70)];
        _picFourImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_picFourImage];
    }
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    return self;
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
